home *** CD-ROM | disk | FTP | other *** search
- Path: newshost.lanl.gov!tanmoy
- From: tanmoy@qcd.lanl.gov (Tanmoy Bhattacharya)
- Newsgroups: comp.unix.programmer,comp.lang.c
- Subject: Re: Runtime ANSI C checking tool?
- Date: 08 Mar 1996 01:05:01 GMT
- Organization: Los Alamos National Laboratory
- Message-ID: <TANMOY.96Mar7180501@qcd.lanl.gov>
- References: <DnI89B.EnH@pgh.nauticom.net> <p5ag239ede.fsf@lemming.wellfleet.com>
- <826219697snz@genesis.demon.co.uk>
- NNTP-Posting-Host: qcd.lanl.gov
- Mime-Version: 1.0
- Content-Type: text
- In-reply-to: Lawrence Kirby's message of Thu, 07 Mar 96 17:28:17 GMT
-
- In article <826219697snz@genesis.demon.co.uk>
- Lawrence Kirby <fred@genesis.demon.co.uk> writes:
-
- LK: >Well, a well-written ANSI C compiler should handle all language
- LK: >violations, and a well-written ANSI C system library should catch all
- LK: >runtime violations (passing NULL to strcpy() or something, for
- LK: >example).
- LK:
- LK: Not possible in general (at least for the compiler or the standard library)
- LK: e.g.
- LK:
- LK: int foo(int *p, int *q)
- LK: {
- LK: return ++*p + ++*q;
- LK: }
- LK:
- LK: This results in undefined behaviour if the same value is passed for p and
- LK: q.
-
- Well, it is possible for the compiler to put in a runtime check :-)
-
- Cheers
- Tanmoy
- --
- tanmoy@qcd.lanl.gov(128.165.23.46) DECNET: BETA::"tanmoy@lanl.gov"(1.218=1242)
- Tanmoy Bhattacharya O:T-8(MS B285)LANL,NM87545 H:#9,3000,Trinity Drive,NM87544
- Others see <gopher://yaleinfo.yale.edu:7700/00/Internet-People/internet-mail>,
- <http://alpha.acast.nova.edu/cgi-bin/inmgq.pl>or<ftp://csd4.csd.uwm.edu/pub/
- internetwork-mail-guide>. -- <http://nqcd.lanl.gov/people/tanmoy/tanmoy.html>
- fax: 1 (505) 665 3003 voice: 1 (505) 665 4733 [ Home: 1 (505) 662 5596 ]
-